package com.yl.pattern.behavioralmodel.command;

/**
 * @Author 小羊
 * @Date 31/10/2024下午 4:36
 * @ClassName Client
 * @Description Client
 */
public class Client {
    public static void main(String[] args) {
        //创建1个订单对象
        Order order1 = new Order();
        order1.setDiningTable(1);
        order1.setFood("土豆肉丝",1);
        order1.setFood("可乐",2);

        //创建第二个订单对象
        Order order2 = new Order();
        order2.setDiningTable(2);
        order2.setFood("肉丝",1);
        order2.setFood("雪碧",2);

        //创建厨师对象
        SeniorChef chef = new SeniorChef();
        //创建命令对象
        OrderCommand command1 = new OrderCommand(chef,order1);
        OrderCommand command2 = new OrderCommand(chef,order2);

        //创建调用者（服务员对象）
        Waiter waiter = new Waiter();
        waiter.setCommand(command1);
        waiter.setCommand(command2);
        waiter.orderUp();

        //让服务员发起命令
    }
}
